﻿
@{
    ViewBag.Title = "快递公司管理";
    Layout = "~/Views/Shared/layoutCommon.cshtml";
}
<section class="content-header">
    <h1>
        快递公司管理
        <small></small>
    </h1>
    <ol class="breadcrumb">
        <li><a href="#"><i class="fa fa-dashboard"></i>主页</a></li>
        <li class="active">快递公司管理</li>
    </ol>
</section>
<section class="content">
    <div class="row">
        <div class="col-md-12">
            <div class="box box-primary">
                <div class="box-header">
                    <div class="form-inline">
                        <div class="form-group">
                            <button type="button" class="btn btn-success btn-sm" id="btnAdd">添加快递公司</button>
                        </div>
                        <h3 class="box-title"></h3>

                    </div>
                </div>
                <div id="datatable">

                </div>

                <!-- /.box-body -->
                <!-- /.box -->
            </div>
        </div>
    </div>
</section>
@section scriptsBottom{
    <script type="text/javascript">
        $(document).ready(function () {
            search();
            $("#btnSearch").click(function () {
                search();
            });
            $("#btnAdd").click(function () {
                add();
            });
        });
        //页码
        var pageIndex = 1;
        //查询
        function search() {
            $("#datatable").load('@Url.Action("ExpressPartialList", "BasicData")', {}, function (data) {
                document.getElementById('datatable').innerHTML = data;
            })
        }
        //修改
        function add(title, id) {
            var url = '@Url.Action("ExpressEdit", "BasicData")'
            BMCW.showTopLayer(title, url, 1100, 700);
        }



        //删除
        function del(id) {
            var url = '@Url.Action("ExpressLogicDelete", "BasicData")';
            BMCW.DataConfirm("", function () {
                BMCW.ajax({
                    url: url,
                    type: "Post",
                    data: {
                        id: id
                    },
                    success: function (o) {
                        if (o.status == 0) {
                            BMCW.msg("删除成功", function () {
                                search();
                            });

                        } else {
                            BMCW.alert("删除失败");
                        }
                    }
                });
            })
        }


    </script>
}

